﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel.Web;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace Moddb08_WCF
{
    /// <summary>
    /// This class modles a Sql Database Table
    /// The XmlRoot attribute specify the name of the xml tag
    /// that will be generated when serializing the class.
    /// </summary>
    [XmlRoot(ElementName="table")]
    [XmlType(TypeName="table")]
    public class Table
    {
        /// <summary>
        /// Contains the name of the table
        /// </summary>
        private string _name;
        /// <summary>
        /// Consturctor that takes a parameter
        /// </summary>
        /// <param name="name"> The name of the table</param>
        public Table(string name)
        {
            _name = name;
        }

        /// <summary>
        /// The default constructor
        /// </summary>
        public Table()
        {
        }

        /// <summary>
        /// Get and set the name property of the table
        /// </summary>
        [XmlAttribute(AttributeName = "name")]
        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                _name = value;
            }
        }
    }
}
